<%@page language="java" contentType="text/html;charset=UTF-8"%>
<%@include file="/WEB-INF/core/common/top.jsp" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<link type="text/css" rel="stylesheet" href="${ctx}/core/styles/validatorAuto.css" />
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>


<script language="javascript">
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"submitForm",onerror:function(msg){showMessage(msg);}});
		$("#title").formValidator().inputValidator({min:1,max:255,onerrormin:"<s:text name='metadata.title.not.empty'/>",onerrormax:"<s:text name='metadata.title.over.length'/>"});
		$("#actor").formValidator().inputValidator({min:1,max:255,onerror:"<s:text name='metadata.actor.not.empty'/>",onerrormax:"<s:text name='metadata.actor.over.length'/>"});
		$("#director").formValidator().inputValidator({min:1,max:255,onerror:"<s:text name='metadata.director.not.empty'/>",onerrormax:"<s:text name='metadata.director.over.length'/>"});
		$("#genreText").formValidator().inputValidator({min:1,max:255,onerror:"<s:text name='metadata.genre.not.empty'/>",onerrormax:"<s:text name='metadata.genre.over.length'/>"});
		$("#origin").formValidator().inputValidator({min:0,onerror:"<s:text name='metadata.origin.not.empty'/>"});
		$("#bitrate").formValidator().inputValidator({min:1,type:"number",onerror:"<s:text name='metadata.bitrate.not.empty'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='metadata.bitrate.not.integer'/>"});
	});	


	function doCancel(){
		location='${ctx}/contentManage/contentMetadate.action?act=reQuery';
	}
	
function loading(contentId)
{
	var url="${ctx}/contentManage/metadataOpt.action?act=loadGenre&contentId="+contentId;
	
	var feature = "width=500,height=500,directories=no,toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes";
	var wnd = window.open(url, "dictionary", feature);
	wnd.focus();
}	
</script>

<body style="overflow-x:hidden;overflow-y:auto;" >

<form method="post" action="${ctx}/contentManage/metadataOpt.action" name="submitForm" id="submitForm">

		<s:hidden name="act" value="editSubmit"></s:hidden>
		<s:hidden name="metadata.contid" value="%{metadata.contid}" />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
	<tr>
		<td width="8" height="27" align="left"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td> 
  		<td width="99%"  align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="metadata.modify"/></td>
  		<td width="8" align="right"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
  	</tr>
  <tr>
    <td colspan="3" class="biaoge">
         <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
                 <tr>
                      <td width="6%" bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.contid"  />&nbsp;</td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      			<s:property value="metadata.contid"/>
					  </td>

					  <td width="6%" bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.title"  />&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      			<s:textfield id="title" name="metadata.title" value="%{metadata.title}" theme="simple" class="textbox_css" style="width:200px"/>
					  </td>
                 </tr>
                 <tr>
                      <td  bgcolor="#DDE4EA" height="23" nowrap>&nbsp;<s:text name="metadata.provider"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:property value="metadata.providerName"/>
					  </td>

					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.providerid"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:property value="metadata.providerId"/>
					  </td>
                 </tr>              
                 <tr>
                      <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.actor"/>&nbsp;<font color="red">*</font></td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:textfield id="actor" name="metadata.actor" value="%{metadata.actor}" theme="simple" class="textbox_css" style="width:200px"/>
					  </td>

					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.director"/>&nbsp;<font color="red">*</font></td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:textfield id="director" name="metadata.director" value="%{metadata.director}" theme="simple" class="textbox_css" style="width:200px"/>
					  </td>
                 </tr>
                 <tr>
                      <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.genre"/>&nbsp;<font color="red">*</font></td>
                      <td  bgcolor="#DDE4EA" nowrap>
					  		<s:textarea readonly="true" id="genreText" name="genreText"  class="textbox_css" cols="22" rows="3" theme="simple"/>&nbsp;<img style="cursor:hand;" onclick="loading('<s:property value="metadata.contid"/>');" src="${ctx}/core/images/status_green.gif" border="0">
					  		<s:hidden name="metadata.genre" id="genre"></s:hidden>
					  </td>

					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.origin"/>&nbsp;<font color="red">*</font></td>
                      <td  bgcolor="#DDE4EA" >
					 		<select id="origin" name="metadata.origin" style="width:100px">
					  			<option value="cn" <s:if test="metadata.originChina==1">selected</s:if>><s:text name="China"/></option>
					  			<option value="us" <s:if test="metadata.originAmerica==1">selected</s:if>><s:text name="America"/></option>
					  			<option value="japan" <s:if test="metadata.originJapan==1">selected</s:if>><s:text name="Japan"/></option>
					  			<option value="korea" <s:if test="metadata.originKorea==1">selected</s:if>><s:text name="Korea"/></option>
					  			<option value="taiwan" <s:if test="metadata.originTaiwan==1">selected</s:if>><s:text name="Taiwan"/></option>
					  			<option value="hk" <s:if test="metadata.originHongkong==1">selected</s:if>><s:text name="Hongkong"/></option>
					  			<option value="other" <s:if test="metadata.originOther==1">selected</s:if>><s:text name="Other"/></option>
					  		</select>
					  </td>
                 </tr>
                 <tr>
                      <td  bgcolor="#DDE4EA" height="23" nowrap>&nbsp;<s:text name="metadata.language"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:property value="metadata.language"/>
					  </td>

					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.hd"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:if test="metadata.hdFlag==0"><s:text name="label.No"/></s:if><s:if test="metadata.hdFlag==1"><s:text name="label.Yes"/></s:if>
					  </td>
                 </tr>
                 <tr>
                      <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.rating"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      	<s:property value="metadata.rating"/>
					  </td>

					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.bitrate"/>&nbsp;<font color="red">*</font></td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:textfield id="bitrate" name="metadata.bitrate" theme="simple" value="%{metadata.bitrate}" class="textbox_css" style="width:100px"/> K
					  </td>
                 </tr>
                 <tr>
                      <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.runtime"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
                      		<s:property value="metadata.runTime"/>
					  </td>
                      <td height="23" bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.status"/>&nbsp;</td>
                      <td " bgcolor="#DDE4EA" >
					  		<s:if test="metadata.status==0">OutOfService</s:if><s:if test="metadata.status==1">InService</s:if><s:if test="metadata.status==-1">Destroy</s:if>
					  </td>
                 </tr>
                 <tr>
					  <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.releaseDate"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
					  		<s:date name="metadata.releaseDate" format="yyyy-MM-dd HH:mm:ss" />
					  </td>                
					  <td height="23"  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="task.creation.time"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA">
					  		<s:date name="metadata.creationDate" format="yyyy-MM-dd HH:mm:ss" />
					  </td>
                 </tr>            
                 <tr>
                      <td  bgcolor="#DDE4EA" nowrap>&nbsp;<s:text name="metadata.summary"/>&nbsp;</td>
                      <td bgcolor="#DDE4EA" colspan=3>
                      		<s:textarea name="metadata.explanation" cols="70" rows="5" theme="simple"></s:textarea>
					  </td>
                 </tr>                 
                 <tr>
                      <td height="10" colspan="4" background="../core/images/line5.gif">&nbsp;</td>
                 </tr>
                 <tr>
                      <td height="25" colspan="4" align="center">
							<input name="button22" type="submit" class="btn" value=" <s:text name='button.save'/> "/>
			                <input type="button" name="Button11" value=" <s:text name='button.return' /> " class="btn" onClick="doCancel();" />
			           </td>
                 </tr>
             </table>
            </td>
          </tr>
    </table>
   </form>
</body>
